package org.example.design.chainofresponsibility.test2;

/**
 * @author huangshen
 * @version 0
 * @description 总经理处理类
 * @since 2022/2/10 13:47
 */
public class GManagerLeaveHandler extends AbstractLeaveHandler {
    public GManagerLeaveHandler(String name) {
        this.handlerName = name;
    }

    /**
     * 确认审批流程
     *
     * @param request
     */
    @Override
    protected boolean resolve(LeaveRequest request) {
        return request.getLeaveDays() >= this.gManagerApproveThresholdDate;
    }

    @Override
    protected void done(LeaveRequest request) {
        System.out.println("总经理:" + handlerName + ",已经处理" + request.getName()
                + "的" + request.getLeaveDays() + "日请假申请");
    }
}
